\(\int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx\) [23]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 81 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\frac {B x^2 \sqrt {a+b x^2}}{3 b}-\frac {(4 a B-3 A b x) \sqrt {a+b x^2}}{6 b^2}-\frac {a A \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{2 b^{3/2}} \]

[Out]

-1/2*a*A*arctanh(x*b^(1/2)/(b*x^2+a)^(1/2))/b^(3/2)+1/3*B*x^2*(b*x^2+a)^(1/2)/b-1/6*(-3*A*b*x+4*B*a)*(b*x^2+a)
^(1/2)/b^2

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {847, 794, 223, 212} \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=-\frac {a A \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{2 b^{3/2}}-\frac {\sqrt {a+b x^2} (4 a B-3 A b x)}{6 b^2}+\frac {B x^2 \sqrt {a+b x^2}}{3 b} \]

[In]

Int[(x^2*(A + B*x))/Sqrt[a + b*x^2],x]

[Out]

(B*x^2*Sqrt[a + b*x^2])/(3*b) - ((4*a*B - 3*A*b*x)*Sqrt[a + b*x^2])/(6*b^2) - (a*A*ArcTanh[(Sqrt[b]*x)/Sqrt[a
+ b*x^2]])/(2*b^(3/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 794

Int[((d_.) + (e_.)*(x_))*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((e*f + d*g)*(2*p
+ 3) + 2*e*g*(p + 1)*x)*((a + c*x^2)^(p + 1)/(2*c*(p + 1)*(2*p + 3))), x] - Dist[(a*e*g - c*d*f*(2*p + 3))/(c*
(2*p + 3)), Int[(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] &&  !LeQ[p, -1]

Rule 847

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[g*(d + e*x)^
m*((a + c*x^2)^(p + 1)/(c*(m + 2*p + 2))), x] + Dist[1/(c*(m + 2*p + 2)), Int[(d + e*x)^(m - 1)*(a + c*x^2)^p*
Simp[c*d*f*(m + 2*p + 2) - a*e*g*m + c*(e*f*(m + 2*p + 2) + d*g*m)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, p
}, x] && NeQ[c*d^2 + a*e^2, 0] && GtQ[m, 0] && NeQ[m + 2*p + 2, 0] && (IntegerQ[m] || IntegerQ[p] || IntegersQ
[2*m, 2*p]) &&  !(IGtQ[m, 0] && EqQ[f, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {B x^2 \sqrt {a+b x^2}}{3 b}+\frac {\int \frac {x (-2 a B+3 A b x)}{\sqrt {a+b x^2}} \, dx}{3 b} \\ & = \frac {B x^2 \sqrt {a+b x^2}}{3 b}-\frac {(4 a B-3 A b x) \sqrt {a+b x^2}}{6 b^2}-\frac {(a A) \int \frac {1}{\sqrt {a+b x^2}} \, dx}{2 b} \\ & = \frac {B x^2 \sqrt {a+b x^2}}{3 b}-\frac {(4 a B-3 A b x) \sqrt {a+b x^2}}{6 b^2}-\frac {(a A) \text {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {x}{\sqrt {a+b x^2}}\right )}{2 b} \\ & = \frac {B x^2 \sqrt {a+b x^2}}{3 b}-\frac {(4 a B-3 A b x) \sqrt {a+b x^2}}{6 b^2}-\frac {a A \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{2 b^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.31 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.91 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\frac {\sqrt {a+b x^2} \left (-4 a B+3 A b x+2 b B x^2\right )}{6 b^2}-\frac {a A \text {arctanh}\left (\frac {\sqrt {b} x}{-\sqrt {a}+\sqrt {a+b x^2}}\right )}{b^{3/2}} \]

[In]

Integrate[(x^2*(A + B*x))/Sqrt[a + b*x^2],x]

[Out]

(Sqrt[a + b*x^2]*(-4*a*B + 3*A*b*x + 2*b*B*x^2))/(6*b^2) - (a*A*ArcTanh[(Sqrt[b]*x)/(-Sqrt[a] + Sqrt[a + b*x^2
])])/b^(3/2)

Maple [A] (verified)

Time = 3.38 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.69

method result size
risch \(\frac {\left (2 b B \,x^{2}+3 A b x -4 B a \right ) \sqrt {b \,x^{2}+a}}{6 b^{2}}-\frac {a A \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{2 b^{\frac {3}{2}}}\) \(56\)
default \(B \left (\frac {x^{2} \sqrt {b \,x^{2}+a}}{3 b}-\frac {2 a \sqrt {b \,x^{2}+a}}{3 b^{2}}\right )+A \left (\frac {x \sqrt {b \,x^{2}+a}}{2 b}-\frac {a \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{2 b^{\frac {3}{2}}}\right )\) \(77\)

[In]

int(x^2*(B*x+A)/(b*x^2+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/6*(2*B*b*x^2+3*A*b*x-4*B*a)/b^2*(b*x^2+a)^(1/2)-1/2*a*A/b^(3/2)*ln(x*b^(1/2)+(b*x^2+a)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.57 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\left [\frac {3 \, A a \sqrt {b} \log \left (-2 \, b x^{2} + 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right ) + 2 \, {\left (2 \, B b x^{2} + 3 \, A b x - 4 \, B a\right )} \sqrt {b x^{2} + a}}{12 \, b^{2}}, \frac {3 \, A a \sqrt {-b} \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right ) + {\left (2 \, B b x^{2} + 3 \, A b x - 4 \, B a\right )} \sqrt {b x^{2} + a}}{6 \, b^{2}}\right ] \]

[In]

integrate(x^2*(B*x+A)/(b*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[1/12*(3*A*a*sqrt(b)*log(-2*b*x^2 + 2*sqrt(b*x^2 + a)*sqrt(b)*x - a) + 2*(2*B*b*x^2 + 3*A*b*x - 4*B*a)*sqrt(b*
x^2 + a))/b^2, 1/6*(3*A*a*sqrt(-b)*arctan(sqrt(-b)*x/sqrt(b*x^2 + a)) + (2*B*b*x^2 + 3*A*b*x - 4*B*a)*sqrt(b*x
^2 + a))/b^2]

Sympy [A] (verification not implemented)

Time = 0.39 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.26 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\begin {cases} - \frac {A a \left (\begin {cases} \frac {\log {\left (2 \sqrt {b} \sqrt {a + b x^{2}} + 2 b x \right )}}{\sqrt {b}} & \text {for}\: a \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {b x^{2}}} & \text {otherwise} \end {cases}\right )}{2 b} + \sqrt {a + b x^{2}} \left (\frac {A x}{2 b} - \frac {2 B a}{3 b^{2}} + \frac {B x^{2}}{3 b}\right ) & \text {for}\: b \neq 0 \\\frac {\frac {A x^{3}}{3} + \frac {B x^{4}}{4}}{\sqrt {a}} & \text {otherwise} \end {cases} \]

[In]

integrate(x**2*(B*x+A)/(b*x**2+a)**(1/2),x)

[Out]

Piecewise((-A*a*Piecewise((log(2*sqrt(b)*sqrt(a + b*x**2) + 2*b*x)/sqrt(b), Ne(a, 0)), (x*log(x)/sqrt(b*x**2),
 True))/(2*b) + sqrt(a + b*x**2)*(A*x/(2*b) - 2*B*a/(3*b**2) + B*x**2/(3*b)), Ne(b, 0)), ((A*x**3/3 + B*x**4/4
)/sqrt(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.83 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\frac {\sqrt {b x^{2} + a} B x^{2}}{3 \, b} + \frac {\sqrt {b x^{2} + a} A x}{2 \, b} - \frac {A a \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{2 \, b^{\frac {3}{2}}} - \frac {2 \, \sqrt {b x^{2} + a} B a}{3 \, b^{2}} \]

[In]

integrate(x^2*(B*x+A)/(b*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

1/3*sqrt(b*x^2 + a)*B*x^2/b + 1/2*sqrt(b*x^2 + a)*A*x/b - 1/2*A*a*arcsinh(b*x/sqrt(a*b))/b^(3/2) - 2/3*sqrt(b*
x^2 + a)*B*a/b^2

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.75 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\frac {1}{6} \, \sqrt {b x^{2} + a} {\left ({\left (\frac {2 \, B x}{b} + \frac {3 \, A}{b}\right )} x - \frac {4 \, B a}{b^{2}}\right )} + \frac {A a \log \left ({\left | -\sqrt {b} x + \sqrt {b x^{2} + a} \right |}\right )}{2 \, b^{\frac {3}{2}}} \]

[In]

integrate(x^2*(B*x+A)/(b*x^2+a)^(1/2),x, algorithm="giac")

[Out]

1/6*sqrt(b*x^2 + a)*((2*B*x/b + 3*A/b)*x - 4*B*a/b^2) + 1/2*A*a*log(abs(-sqrt(b)*x + sqrt(b*x^2 + a)))/b^(3/2)

Mupad [B] (verification not implemented)

Time = 6.34 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.15 \[ \int \frac {x^2 (A+B x)}{\sqrt {a+b x^2}} \, dx=\left \{\begin {array}{cl} \frac {3\,B\,x^4+4\,A\,x^3}{12\,\sqrt {a}} & \text {\ if\ \ }b=0\\ \frac {A\,x\,\sqrt {b\,x^2+a}}{2\,b}-\frac {A\,a\,\ln \left (2\,\sqrt {b}\,x+2\,\sqrt {b\,x^2+a}\right )}{2\,b^{3/2}}-\frac {B\,\sqrt {b\,x^2+a}\,\left (2\,a-b\,x^2\right )}{3\,b^2} & \text {\ if\ \ }b\neq 0 \end {array}\right . \]

[In]

int((x^2*(A + B*x))/(a + b*x^2)^(1/2),x)

[Out]

piecewise(b == 0, (4*A*x^3 + 3*B*x^4)/(12*a^(1/2)), b ~= 0, - (A*a*log(2*b^(1/2)*x + 2*(a + b*x^2)^(1/2)))/(2*
b^(3/2)) + (A*x*(a + b*x^2)^(1/2))/(2*b) - (B*(a + b*x^2)^(1/2)*(2*a - b*x^2))/(3*b^2))